<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<style type="text/css">
	@IMPORT url("css/core.css");
</style>
<script type="text/javascript" src="js/jquery-1.11.0.js"></script>
<script type="text/javascript">
	$(function(){
		
		$(".mu_a").click(function(){
			
			var href = $(this).attr("href");
			loadHtml(href);
			location.hash = href;
			return false;
		});
		
		function loadHtml(url){
			$("#content").load(url,function(){
				if(url == "addgood.jsp"){
					$("#good_add_btn").click(function(){
						var params = $("form").serialize();
						$.get("UpdateGood?"+params,function(data){
							$("#content").empty();
							if(data == 1){
								$("#content").append("添加成功");
							}else{
								$("#content").append("添加失败");
							}
						})
						
					});
				}
			});
		}
		
		//页面初始化完成的时候调用
		function init(){
			var url = location.hash;
			if(url.length != 0){
				url = url.replace("#","");
				loadHtml(url);
			}
		}
		
		init();
	});
	
	
	
</script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
	<div id="wrap">
		<div id="menu">
			<ul>
				<li><a class="mu_a" href="userlist">用户管理</a></li>
				<li><a class="mu_a" href="OrderQueryServlet">订单管理</a></li>
				<li><a class="mu_a" href="addgood.jsp">添加商品</a></li>
				<li><a class="mu_a" href="QueryGoodsServlet">查看商品</a></li>
			</ul>
		</div>
		<div id="content">
			
		</div>
	</div>	
</body>
</html>